<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let  n1,n2=123,n3=null,n4=true,n5='hello',n6='',n7=0,n8=NaN;//NaN非数字
    console.log(Boolean(n1));//将未定义转为布尔型：false
    console.log(Boolean(n2));//非0数值转布尔型：true
    console.log(Boolean(n3));//null转布尔型：false
    console.log(Boolean(n5));//非空字符转布尔型：true
    console.log(Boolean(n6));//空字符串转布尔型：false
    console.log(Boolean(n7));//0转布尔型：false
    console.log(Boolean(n8));//NaN转布尔型：false
    console.log ('---------');
    console.log(Number(n6));
    console.log(parseInt(n6));
    console.log(parseFloat(n6));
    let  num=parseInt(n6);
    console.log(num);
    console.log(typeof(n6));
</script>
</html>